package com.watson.minio.springminio.minio.config;

import lombok.AllArgsConstructor;
import org.springframework.boot.context.properties.EnableConfigurationProperties;

/**
 * 初始化 MinioClient 自动注入到 spring 容器
 *
 * @author: llun
 * @date: 2022/1/24 10:13
 * @version: 1.0
 */
@AllArgsConstructor
@EnableConfigurationProperties({MinioConfig.class})
public class MinioAutoConfiguration {
    private final MinioConfig properties;

//    @Bean
//    @ConditionalOnMissingBean(MinioTemplate.class)
//    @ConditionalOnProperty(name = "minio.url")
//    MinioClient minioClient() {
//        return new MinioClient(
//                properties.getUrl(),
//                properties.getAccess(),
//                properties.getSecret()
//        );
//    }
}
